package com.joker.yuwu;

import com.joker.repository.RootSearchZg;
import com.joker.repository.RootSearchZw;
import net.sf.json.JSONObject;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;

@WebServlet("/rootsearchzw")
public class RootSearchYdzw extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        super.doGet(req, resp);
        resp.setContentType("text/json; charset=utf-8");

        RootSearchZw r1=new RootSearchZw();
        ArrayList list=null;
        list= r1.show();
//        System.out.println(list);
        JSONObject obj =new JSONObject();
        obj.put("data",list);
        resp.getWriter().write(obj.toString());
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doPost(req, resp);
    }
}
